package com.yuw.control;

import com.yuw.bean.UserInfoBean;
import com.yuw.service.LoginService;

import java.util.List;

public class LoginControl {
    // 使用spring xml的配置方式，进行依赖注入
    LoginService loginService;
    UserInfoBean userInfoBean;

    // 依赖一个集合对象，也可以进行依赖注入
    List<Object> lstStrs;

    /**
     * 进行登录处理
     *
     * @return
     */
    public boolean doLogin() {
        boolean canLogined = false;

        // 调用service层
        System.out.println("依赖注入的集合的内容：" + lstStrs.toString());
        // 进行登录业务逻辑
        canLogined = loginService.doLogin(userInfoBean);
        return canLogined;
    }

    public LoginService getLoginService() {
        return loginService;
    }

    public void setLoginService(LoginService loginService) {
        this.loginService = loginService;
    }

    public UserInfoBean getUserInfoBean() {
        return userInfoBean;
    }

    public void setUserInfoBean(UserInfoBean userInfoBean) {
        this.userInfoBean = userInfoBean;
    }

    public List<Object> getLstStrs() {
        return lstStrs;
    }

    public void setLstStrs(List<Object> lstStrs) {
        this.lstStrs = lstStrs;
    }
}
